You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ci: add typecheck step and fix existing type errors (#469) - #485
vite build doesn't type-check and there was no typecheck script, so type
errors could never fail CI. On current main, npx tsc --noEmit reports 9 errors
from two root causes:
8x TS2740 in clipboard.test.ts: MockChildProcess was missing ChildProcess members.
Changes:
Add "typecheck": "tsc --noEmit" and run npm run typecheck in CI (after Biome, before tests).
Import execSync in gstManager.ts.
MockChildProcess now extends the real ChildProcess with real PassThrough
stdin/stdout, so no as casts or ! assertions are needed (per AGENTS.md).
Test behavior is unchanged, and the stdin.end spy is kept.
Document the new check in AGENTS.md and CONTRIBUTING.md.
src/server/gstreamer/gstManager.ts(99,17): error TS2304: Cannot find name 'execSync'.
src/server/clipboard.test.ts(66,4 / 77,36 / 87,4 / 106,36 / 123,25 / 124,25 / 139,25 / 140,25):
error TS2740: Type 'MockChildProcess' is missing the following properties from type 'ChildProcess'
Found 9 errors in 2 files.
After: npm run typecheck exits 0. npx @biomejs/biome ci ., npm test (31/31)
and npm run build also pass.
I also checked that the new step really blocks errors: adding a file with const x: number = "oops" made npm run typecheck fail with TS2322, and
removing it made it pass again.
Functional Verification
Tooling/CI change only, with no client, gesture or input behavior modified, so
the device checkboxes are intentionally left unticked.
AI Usage Disclosure
used it for minor fixes and reviewing the diffs.
Checklist
My PR addresses a single issue, fixes a single bug or makes a single improvement.
My code follows the project's code style and conventions
I have performed a self-review of my own code
I have commented my code, particularly in hard-to-understand areas
If applicable, I have made corresponding changes or additions to the documentation
My changes generate no new warnings or errors
I have joined the Discord server and I will share a link to this PR with the project maintainers there
I have read the Contributing Guidelines
Summary by CodeRabbit
Chores
TypeScript type checking now runs as part of the automated validation workflow, alongside formatting checks and tests.
Documentation
Contributor instructions and the pull request checklist now include type checking.
Tests
Updated test coverage for session cleanup and clipboard handling to use revised test setup.
CodeRabbit is using all valid settings from your configuration. Unrecognized properties (listed below) have been ignored and may indicate typos or deprecated fields that can be removed.
Parsing warnings: 1
Validation error: Unrecognized key: "instructions" at "reviews"
If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
No actionable comments were generated in the recent review.
Walkthrough
The package adds a no-emit TypeScript check. CI runs the check, and contributor guidance adds it to required checks. Test updates change a timer callback and replace the clipboard child-process mock with a ChildProcess subclass.
Changes
TypeScript checks
Layer / File(s)
Summary
Add typecheck command and update test mocks package.json, src/server/signalling/handlers/sessionStore.test.ts, tests/server/clipboard.test.ts
The package adds a typecheck script that runs tsc --noEmit. The cleanup test wraps its timer callback. Clipboard tests use a ChildProcess subclass with PassThrough streams and spy on stdin’s end method.
Run and document typechecking .github/workflows/ci.yml, AGENTS.md, CONTRIBUTING.md
CI runs npm run typecheck after Biome Check and before Tests. The agent and contributor instructions add the command to their check requirements.
This adds a TypeScript typecheck to CI and contributor guidance, and adjusts test mocks to satisfy it. It does not change runtime behavior. Merge risk is minimal.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title 'ci: add typecheck step and fix existing type errors (#469)' matches the main changes: a new typecheck script and CI step, plus fixes for the existing TS2304 and TS2740 errors. It is specifi…
Description check
The description follows the template's main sections: it links the issue (Fixes #469), explains the change, gives verification evidence, and includes a checklist. The functional verification section i…
Linked Issues check
[#469] The head adds a typecheck script for tsc --noEmit and a CI step that runs it after Biome and before tests (per the raw summary of package.json and ci.yml). The test mock is fixed: `tests/se…
Out of Scope Changes check
The changes map to #469 and #450. The package.json script, the ci.yml step, and the AGENTS.md and CONTRIBUTING.md documentation implement or describe the typecheck requirement. The `tests/server/c…
Full details: Title check
Explanation
The title 'ci: add typecheck step and fix existing type errors (#469)' matches the main changes: a new typecheck script and CI step, plus fixes for the existing TS2304 and TS2740 errors. It is specific and conventional. The issue number suffix is optional metadata and does not reduce relevance.
Full details: Description check
Explanation
The description follows the template's main sections: it links the issue (Fixes #469), explains the change, gives verification evidence, and includes a checklist. The functional verification section is not ticked, but the author explains that this is a tooling-only change with no client or input behavior modified. The screenshots section is omitted, which is acceptable because the change has no UI. The AI Usage Disclosure is vague ('used it for minor fixes and reviewing the diffs') and has a grammar gap. The template's 'Addressed Issues' heading is renamed, and the 'Screenshots' and 'Additional Notes' headings are missing. These are non-critical gaps.
Full details: Linked Issues check
Explanation
[#469] The head adds a typecheck script for tsc --noEmit and a CI step that runs it after Biome and before tests (per the raw summary of package.json and ci.yml). The test mock is fixed: tests/server/clipboard.test.ts at head defines MockChildProcess extends ChildProcess with PassThrough stdin and stdout, with no as casts or ! assertions. This addresses the eight TS2740 errors. The PR description gives the path src/server/clipboard.test.ts, but that path does not exist at head. The file is tests/server/clipboard.test.ts. The content matches the description, so this is a documentation mismatch only. [#450] src/server/gstreamer/gstManager.ts at head imports execSync from node:child_process, which resolves the TS2304 error and the Linux ReferenceError. The author reports that npm run typecheck exits 0. I did not run the commands, so that result rests on the author's report. #456 is a separate issue and is not required here.
Full details: Out of Scope Changes check
Explanation
The changes map to #469 and #450. The package.json script, the ci.yml step, and the AGENTS.md and CONTRIBUTING.md documentation implement or describe the typecheck requirement. The tests/server/clipboard.test.ts rewrite fixes the mock types required by #469. Its node:child_process mock now spreads importOriginal, which keeps ChildProcess available. The gstManager.ts change is the single import required by #450. The src/server/signalling/handlers/sessionStore.test.ts change wraps onTimeout in an arrow callback. This is a test-only change with no behavior difference. The PR description does not explain it, but it is small and sits within the test-suite type health that the new typecheck gate covers. No unrelated functional change was found.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
A rabbit checks the types at dawn, Then hops where CI carries on. Through streams of code, the tests run clear, A tidy checklist now draws near, And carrots wait when checks are done.
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #469
Description
vite builddoesn't type-check and there was notypecheckscript, so typeerrors could never fail CI. On current main,
npx tsc --noEmitreports 9 errorsfrom two root causes:
gstManager.ts:execSyncwas never imported. This is a realruntime ReferenceError on Linux ([Bug]: ReferenceError: execSync is not defined during Linux audio monitor sink detection in gstManager #450).
clipboard.test.ts:MockChildProcesswas missingChildProcessmembers.Changes:
"typecheck": "tsc --noEmit"and runnpm run typecheckin CI (after Biome, before tests).execSyncingstManager.ts.MockChildProcessnow extends the realChildProcesswith realPassThroughstdin/stdout, so no
ascasts or!assertions are needed (per AGENTS.md).Test behavior is unchanged, and the
stdin.endspy is kept.Evidence
Before (main @ a31bc71),
npx tsc --noEmit:After:
npm run typecheckexits 0.npx @biomejs/biome ci .,npm test(31/31)and
npm run buildalso pass.I also checked that the new step really blocks errors: adding a file with
const x: number = "oops"madenpm run typecheckfail with TS2322, andremoving it made it pass again.
Functional Verification
Tooling/CI change only, with no client, gesture or input behavior modified, so
the device checkboxes are intentionally left unticked.
AI Usage Disclosure
used it for minor fixes and reviewing the diffs.
Checklist
Summary by CodeRabbit